package com.huangguolin.cloud.mybatis.ztree;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 子节点实体类
 */
public class ChildTree implements Serializable {
    private String id;
    private String label;
    private String pId;
    private List<ChildTree> children = new ArrayList<>();
    public ChildTree(ZtreeEntity ztreeEntity){
        id = ztreeEntity.getId();
        label = ztreeEntity.getName();
        pId = ztreeEntity.getpId();
    }

    public String getpId() {
        return pId;
    }

    public void setpId(String pId) {
        this.pId = pId;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public List<ChildTree> getChildren() {
        return children;
    }

    public void setChildren(List<ChildTree> children) {
        this.children = children;
    }

    public void addChildren(ChildTree item) {
        this.children.add(item);
    }
}

